using UnityEngine;

public class MyBag : MonoBehaviour
{
    public bool isOpen;

    private Animator _bagAnimator;

    void Start()
    {
        _bagAnimator = GetComponent<Animator>();
    }

    public void SetBag()
    {
        if (!isOpen)
        {
            isOpen = true;
            _bagAnimator.SetBool("Close", false);
            _bagAnimator.SetBool("Open", true);
        }
        else
        {
            isOpen = false;
            _bagAnimator.SetBool("Open", false);
            _bagAnimator.SetBool("Close", true);
        }
    }
}
